test(connection): add regression tests for MULTI/EXEC tx-queue stall#7273
Merged
Conversation
🤖 Augment PR SummarySummary: Adds regression coverage for issue #7272, where a blocked MULTI/EXEC reply can stall other transactions by holding a shard lock. Changes:
Technical Notes: These tests intentionally induce TCP backpressure (client not reading) to force server-side 🤖 Was this summary useful? React with 👍 or 👎 |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Python integration tests to reproduce and detect the MULTI/EXEC tx-queue stall incident described in #7272, focusing on blocked socket sends during EXEC and the resulting “phantom” connections in CLIENT LIST.
Changes:
- Add
test_multi_exec_phantom_connectionsto reproduceaddr=0.0.0.0+phase=processphantom connections when a clogger holds the shard lock and ghosts RST-close. - Add
test_multi_exec_stuck_send_stalls_txto reproduce a shard-lock stall caused by a blocked send during EXEC, and verify recovery viasend_timeout.
58fddef to
6e79d69
Compare
…t::OnSocketError Remove the ad-hoc breaker callback from Connection in favor of polymorphic dispatch through ConnectionContext: - Remove Connection::RegisterBreakHook(), BreakerCb type, and breaker_cb_ member - Add virtual OnSocketError(uint32_t) to facade::ConnectionContext - Implement ConnectionContext::OnSocketError to cancel blocking transactions, replacing the RegisterBreakHook lambda registered in Service::CreateContext() - Register the error callback unconditionally (was gated on breaker_cb_ being set) - Expose phase=scheduled in CLIENT LIST: coordinator fiber is blocked in run_barrier_.Wait() inside Transaction::Execute() while waiting for shard callback - Add test_multi_exec_phantom_connections to reproduce the scenario from issue #7272 Signed-off-by: Roman Gershman <roman@dragonflydb.io>
6e79d69 to
6fd81ec
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
`ConnectionContext::OnSocketError` — cleaner polymorphic dispatch, no ad-hoc
callback registered in `Service::CreateContext()`
whose coordinator fiber is stuck waiting for a shard callback inside
`Transaction::Execute()`
MULTI/EXEC Transaction Queue Deadlock on Silent Client Disconnect #7272, where ghost connections appear with `addr=0.0.0.0` and `phase=scheduled`
in `CLIENT LIST` while their transactions are queued behind a lock-holding connection
Changes
`breaker_cb_`; register error callback unconditionally; `BreakOnce()` delegates to `cc_->OnSocketError()`
add `is_scheduled` computation in `GetContextInfo()`
`blocked`→`is_blocked`; add `is_scheduled` field to `ContextInfo`
🤖 Generated with Claude Code